Method and Apparatus for Polarity Detection of Loudspeaker

ABSTRACT

A method and apparatus for polarity detection. The method includes applying a band-pass filter to an impulse response of a loudspeaker, applying an exponential weighting to the band-pass filtered impulse response, wherein the exponential decay parameter is related to the higher corner frequency of the band-pass filter, finding the maximum peak in a waveform of sampled impulse responses, and detecting the connection polarity of the maximum peak as the polarity of the peak.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Embodiments of the present invention generally relate to a method andapparatus for loudspeaker polarity detection. More specifically, amethod and apparatus for multi-way loudspeaker polarity detection.

2. Background of the Invention

It has become popular for audio amplifiers to have an automaticloudspeaker configuration function as multi-channel audio systems becamewidespread. Polarity detection is one of the features commonly supportedby such automatic loudspeaker systems, which include configurationfunctions to ensure that the loudspeakers are wired correctly in termsof the connection polarity. For example, the polarity detection ensuresthe proper connection of the positive/negative terminal of theloudspeaker and the positive/negative terminal of the audio amplifier.

However, the polarity detection is known to be susceptible to themicrophone position and room reflections. In addition, the polaritydetection tends to be more unstable for multi-way loudspeakers due tothe spatial separation of speaker drivers.

Therefore, there is a need for an improved loudspeaker polaritydetection method and apparatus.

SUMMARY OF THE INVENTION

Embodiments of the present invention relate to a method and apparatusfor method and apparatus for polarity detection. The method includesapplying a band-pass filter to an impulse response of a loudspeaker,applying an exponential weighting to the band-pass filtered impulseresponse, wherein the exponential decay parameter is related to thehigher corner frequency of the band-pass filter, finding the maximumpeak in a waveform of sampled impulse responses, and detecting theconnection polarity of the maximum peak as the polarity of the peak.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited features of the presentinvention can be understood in detail, a more particular description ofthe invention, briefly summarized above, may be had by reference toembodiments, some of which are illustrated in the appended drawings. Itis to be noted, however, that the appended drawings illustrate onlytypical embodiments of this invention and are therefore not to beconsidered limiting of its scope, for the invention may admit to otherequally effective embodiments. A computer readable medium is any mediumthat can be utilized by a computer to read, write or save data. Such amedium may be coupled to, external or internal to the computer.

FIG. 1 is an embodiment of a polarity detection of multi-way loudspeakerconnection by audio amplifiers;

FIG. 2 is an embodiment of an impulse response of a single-wayloudspeaker;

FIG. 3 is an embodiment of an impulse response of the same two three-wayloudspeakers;

FIG. 4 is an embodiment of a band-pass filter impulse response;

FIG. 5 is an embodiment depicting exponential decay of weight applied toband-pass filtered impulse response;

FIG. 6 is an embodiment depicting a frequency response H(k) for thefront left channel; and

FIG. 6 is an embodiment depicting a band-pass filtered frequencyresponse H(k) for a front left channel (f_(L)=50 Hz and f_(H)=25 Hz).

DETAILED DESCRIPTION

Along with the home theater systems, multi-channel audio systems havebecome more popular in home audio applications, which have becomewidespread. It is common for such multi-channel audio systems to havethe 5.1 ch configuration, i.e., five satellite speakers and onesub-woofer or even more such as the 7.1 ch systems. However, it can be adifficult task to set up a multi-channel environment appropriately. Theusers need to wire the loudspeakers to the audio amplifier with longcables and adjust channel delay and volume balance according to theplacement of the loudspeakers. To help ease the setup, the latest audioamplifiers are usually equipped with means to measure the loudspeakerdistance, loudness, and frequency characteristics. In addition, suchamplifiers are capable of automatically configuring the loudspeakerdelay, volume, and equalize the frequency characteristics.

FIG. 1 is an embodiment of a polarity detection of multi-way loudspeakerconnection by audio amplifier. As shown in FIG. 1, the audio amplifieroutputs test signals from the loudspeakers, and records the reproducedsound with the microphone placed at the listening position. The recordedsignals are used to analyze the loudspeaker configuration and set theadjustment parameters. As for the test signal, signals that cover thewide range of frequencies, such as, white noise, pink noise, and sweptsinusoid, are used. The recorded signals are de-convolved with the testsignal to obtain the loudspeakers' impulse response.

In such automatic loudspeaker setup applications, the polarity of theloudspeaker connection is generally checked first once the loudspeaker'spresence is detected. Namely, it is checked if users correctly wire thepositive terminals and negative terminals of the loudspeaker and theaudio amplifier. If the negative (i.e. wrong) connection is detected asin the case of the front right channel in FIG. 1, the audio amplifierwould prompt the users to check the wiring. The connection polarity maybe detected from the impulse response of the loudspeakers.

FIG. 2 is an embodiment of an impulse response of a single-wayloudspeaker. In FIG. 2, since a large impulse on the positive side isshown, then one deduces that FIG. 2 shows a positive polarity. Thus, itcan be said that this loudspeaker is connected correctly in the positivedirection. However, the polarity is sometimes very ambiguous especiallywhen the multi-way loudspeakers are used.

For example, FIG. 3 shows an embodiment of an impulse response of thesame two three-way loudspeakers. The loudspeakers of FIG. 3 are bothpositively connected and placed at the front left and the front rightpositions, respectively. The impulse response of the front right channelclearly shows that it is wired correctly with the positive connection.However, the polarity is unclear for the front left channel. In fact,one might even conclude that the front left has the negative polaritydue to the sharp and large negative impulse.

The difficulty of detecting the polarity for multi-way loudspeakersoriginates in the fact that they are composed of multiple drivers suchas a tweeter, midrange, and woofer. The impulse response measured by themicrophone is the superposition of the responses of those differentdrivers at the microphone position. However, the way of superpositionvaries depending on the microphone position. This is because the driversare placed apart in the three dimensional space, and thus the relativedistance to them from the microphone can change depending on themicrophone position. The impulse response is also affected by the roomreflections from the floor, wall, ceiling, and other furniture in theroom. On top of that, a loudspeaker designer may deliberately setdifferent polarity for each driver by the cross-over circuit inside theloudspeaker box for some reasons such as to produce a better sound.Therefore, it is not simple to define and detect the loudspeakerpolarity from the measured impulse response for the multi-wayloudspeakers.

Thus, in one embodiment, the detection of loudspeaker connectionpolarity is based on their impulse response. As a result, the connectionpolarity for multi-way loudspeakers is robustly detected. Such anembodiment may also be used for single-way loudspeakers. The proposedmethod is based on the peak detection of the impulse response. However,the impulse response is modified with band-pass filtering andexponential weighting prior to the peak detection in order to improvethe robustness.

This embodiment proposes to detect the polarity of the midrange andwoofer drivers as the polarity of multi-way loudspeakers for thefollowing reasons:

1. The frequency range of most of midrange and woofer drivers covers 1kHz, which is expected to be reproducible by all acoustic loudspeakerseven if they have a tiny scale factor and thus are much less efficient.In fact, such frequency is used by standard test tone signals quiteoften. In this sense, the polarity detection methods, which rely on thefrequency range of typical midrange and woofer drivers, are applicableto all kinds of acoustic loudspeakers.

2. The responses of the midrange and woofer drivers are less affectedthan that of the tweeter by room reflections or by microphone position.Since the tweeter response is largely composed of high frequencies byits nature, it is more oscillatory in a shorter period than that of themidrange and woofer drivers. Thus, when the direct wave response of thetweeter is added with its reflections at the microphone position, thoseoscillatory waveforms can cancel their signal peaks with each other.Hence, one can deduct that the polarity detection methods that use thetweeter response tend to be more unstable in terms of the influence ofthe microphone position and the room reflections, as shown in FIG. 3. InFIG. 3, the sharp or high frequency peaks appear in a very different wayin the front left and in the front right channels, while greatersimilarity can be recognized in the low frequency part of the twoimpulse responses.

3. The extraction of the midrange and woofer responses eliminates theinterference with the tweeter response. The interference between themidrange and woofer responses and the tweeter response is sensitive tothe microphone position because it originates in the spatial separationof those drivers. On the other hand, since the midrange and wooferresponses are composed of low frequencies, they are less affected by themicrophone position. Namely, the wavelength is typically longer than theseparation of the midrange and the woofer drivers. These facts giveanother reason for the polarity detection methods being unstable if theyrely on the tweeter response.

Therefore, a band-pass filter (BPF) is applied to the measured impulseresponse in order to extract low frequencies that correspond to themidrange and the woofer drivers. The higher corner frequency of theband-pass filter is set to the typical cross-over frequency between themidrange and the tweeter.

On the other hand, the lower corner frequency of the band-pass filter isdetermined with respect to the background noise. The background noiseusually has pink-noise characteristics, i.e., it has more energy in thelow frequency region and less energy in the high frequency region.Hence, it is desirable to filter off the low frequency part of themeasured impulse response to reduce the noise component. Otherwise, thelow frequency errors will lead to a DC offset error, which disturbs thepeak detection.

Applying the band-pass filter to the impulse responses of FIG. 3 isshown in FIG. 4. FIG. 4 is an embodiment of a band-pass filter impulseresponse. In FIG. 4, the lower and the higher corner frequency of theband-pass filter is 50 Hz and 2 kHz, respectively. By eliminating thetweeter response that is sensitive to the microphone position and theroom reflections, it can be seen that the polarity now can robustly bedetected as the polarity of the first peak of the band-pass filteredimpulse response. However, there can be seen several peaks of competingmagnitude in the waveforms. In fact, the maximum peak does not alwayscorrespond to the first peak.

The present invention proposes to apply exponential weighting to theband-pass filtered impulse response to enable the first peak being foundas the maximum peak. The decay rate of the exponential weighting isrelated to the higher corner frequency of the band-pass filter. This isbecause the duration between the neighboring peaks in the band-passfiltered impulse response is roughly limited by the higher cornerfrequency. The duration may not be much shorter than 1/(2 fH), where fHis the higher corner frequency of the band-pass filter. In fact, it canbe confirmed that the duration between peaks is close to 1/(2 fH)=0.25ms in FIG. 4.

FIG. 5 is an embodiment depicting exponential decay of weight applied toband-pass filtered impulse response. In FIG. 5, the results of theapplication of the exponentially decaying weight to the waveforms inFIG. 4. The weight application begins with the last zero-crossing pointprior to the starting point of the impulse response, which was detectedby some other means, such as a threshold. It can be seen that the firstpeak can now be simply found as the maximum peak in the waveform.Finally, it can be concluded that the connection polarity is positivefor both channels because the maximum peaks lie on the positive side.

Let h(n), n=0, 1, . . . , N−1, be the measured impulse response of theloudspeaker of interest sampled at the sample rate f_(s). Then, we firstextract the midrange and woofer component by applying a band-pass filterto h(n). The band-pass filter to be used is desired to have alinear-phase characteristic in order to preserve the phase informationof h(n). With a non-linear-phase band-pass filter, the phase informationof the extracted waveform will be distorted, and thereby, in the timedomain, its peak location and peak magnitude will be changed. However,this is very critical because the proposed method relies on the peaklocations and the peak values of the extracted waveform.

In the embodiment shown here, a band-pass filter implemented withdiscrete Fourier transform (DFT) is used. Let H(k) be the DFT of theimpulse response h(n) as

${{H(k)} = {\sum\limits_{n = 0}^{N - 1}{{h(n)}W^{- {nk}}}}},{W = {^{{j2}\; {\pi/N}}.}}$

Then, to extract the frequency components that correspond to themidrange and woofer drivers, the band-pass filter is applied in thefrequency domain as

${H_{BPF}(k)} = \left\{ {{{\begin{matrix}0 & \left( {{{k} < K_{L}},{K_{H} < {k} \leq \frac{N}{2}}} \right) \\{H(k)} & {\left( {K_{L} \leq {k} \leq K_{H}} \right),}\end{matrix}K_{L}} = {\frac{f_{L}}{f_{s}}N}},{K_{H} = {\frac{f_{H}}{f_{s}}N}},} \right.$

where f_(L) and f_(H) are the lower and higher corner frequencies of theband-pass filter, respectively, and K_(L) and K_(H) are the frequencybin indices corresponding to f_(L) and f_(H), respectively. FIG. 6 andFIG. 7 show the example of H(k) and H_(BPF)(k) for the front leftchannel of FIG. 3, where f_(s)=48 kHz, f_(L)=50 Hz, f_(H)=2 kHz,N=32,768. By taking the inverse DFT, we can obtain the impulse responsecorresponding to the midrange and woofer drivers as

${h_{BPF}(n)} = {\frac{1}{N}{\sum\limits_{k = {{- N}/2}}^{{N/2} - 1}{{H_{BPF}(k)}{W^{kn}.}}}}$

As shown in FIG. 4, the waveform h_(BPF)(n) can be oscillatory withpeaks of nearly equal magnitude. To help distinguish the first peak fromthe subsequent peaks, the exponentially decaying weight is applied as

${{g(n)} = {^{- {an}}{h_{BPF}(n)}}},{a = {\frac{f_{H}}{f_{s}}.}}$

Note that the decay rate, a, is related to the higher corner frequencyf_(H). This is because the duration between the neighboring peaks isroughly given by 1/(2 f_(H)), and we want to give a consistent decay tothe peaks regardless of the value of f_(H). In this case, the applieddecay from one peak to the next one is e^(−1/2)˜0.6.

Let n_(start) be the time index of the starting point of the impulseresponse, which was detected by some other means, such as, a threshold.Then, we first find the last zero-crossing point, n₀, in the band-passfiltered impulse response, which is usually prior to the starting pointn_(start) (see FIG. 5). Namely, the time index n₀ is the largest timeindex which satisfies

h _(BPF)(n)h _(BPF)(n+1)<0, n<n_(start).

Then, we find the time index n_(peak), where the g(n_(peak)) has itspeak value after the time index n₀.

$n_{peak} = {\underset{n_{0} < n}{argmax}{{g(n)}}}$

Finally, the polarity is determined as the sign of g(n_(peak)).

${polarity} = {{{sgn}\; {g\left( n_{peak} \right)}} = \left\{ \begin{matrix}{+ 1} & \left( {{g\left( n_{peak} \right)} > 0} \right) \\{- 1} & \left( {{g\left( n_{peak} \right)} < 0} \right)\end{matrix} \right.}$

While the foregoing is directed to embodiments of the present invention,other and further embodiments of the invention may be devised withoutdeparting from the basic scope thereof, and the scope thereof isdetermined by the claims that follow.

1. A polarity detection method utilized is an apparatus for polaritydetection of a loudspeaker connection, the method comprising: applying aband-pass filter to an impulse response of a loudspeaker; applying anexponential weighting to the band-pass filtered impulse response,wherein the exponential decay parameter is related to the higher cornerfrequency of the band-pass filter; finding the maximum peak in awaveform of sampled impulse responses; and detecting the connectionpolarity of the maximum peak as the polarity of the peak.
 2. Thepolarity detection method of claim 1, wherein the loudspeaker is atleast one of a single or a group of multi-way loudspeaker.
 3. A polaritydetection apparatus, comprising: means for applying a band-pass filterto an impulse response of a loudspeaker; means for applying anexponential weighting to the band-pass filtered impulse response,wherein the exponential decay parameter is related to the higher cornerfrequency of the band-pass filter; means for finding the maximum peak ina waveform of sampled impulse responses; and means for means fordetecting the connection polarity with the maximum peak as the polarityof the peak.
 4. The polarity detection apparatus of claim 3, wherein theloudspeaker is at least one of a single or a group of multi-wayloudspeaker.
 5. A computer readable medium comprising software that,when executed by a processor, causes the processor to perform a polaritydetection method for polarity detection of a loudspeaker, the polaritydetection method comprising: applying a band-pass filter to an impulseresponse of a loudspeaker; applying an exponential weighting to theband-pass filtered impulse response, wherein the exponential decayparameter is related to the higher corner frequency of the band-passfilter; finding the maximum peak in a waveform of sampled impulseresponses; and detecting the connection polarity of the maximum peak asthe polarity of the peak.
 6. The computer readable medium of claim 6,wherein the loudspeaker is at least one of a single or a group ofmulti-way loudspeaker.